<?$this->load->view('admin/header');?>
<!-- Content Area -->
<div id="middlepart">
    <!-- Left column -->
    <div id="leftcolumn">
        <h1>Site Management</h1>

        <?$this->load->view('admin/system_messages');?>

        <!-- Tables 1 -->
        <table border="0" cellspacing="0" cellpadding="0" width="100%">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>Site Name</th>
                    <th>URL Title</th>
                    <?if ($this->session->userdata('user_type_id') == 1) {?>
                    <th>Default Site</th>
                    <?}?>
                    <th>Template</th>
                    <th>Default View</th>
                    <th>Actions</th>
                </tr>
            </thead>
            <tbody>
                <?foreach ($this->mdl_sites->get(array('paginate'=>TRUE)) as $site) {?>
                <tr>
                    <td><?=$site->site_id;?></td>
                    <td><?=$site->site_name;?></td>
                    <td><?=$site->url_title;?></td>
                        <?if ($this->session->userdata('user_type_id') == 1) {?>
                    <td><?if($site->is_default) {echo"Yes";}else {echo anchor('admin_sites/set_default/site_id/' . $site->site_id, 'No');}?></td>
                        <?}?>
                    <td><?=$site->template_folder;?></td>
                    <td><?=$site->template_default_view;?></td>
                    <td width="125px">
                            <?=anchor('admin_sites/form/site_id/' . $site->site_id, 'edit', array('class'=>'edit'));?>
                            <?if(!$site->is_default AND $this->session->userdata('user_type_id') == 1) {echo anchor('admin_sites/delete/site_id/' . $site->site_id, 'delete', array('class'=>'delete', 'onclick'=>$this->inktype->verify_delete()));}?>
                    </td>
                </tr>
                <?}?>
            </tbody>
        </table>
        <!-- Tables 1 -->
        <br />
        <div style="text-align: center;"><?=$this->mdl_sites->page_links;?></div>
        <br />
    </div>
    <!-- Left Column -->
    <?if ($this->session->userdata('user_type_id') == 1) {?>
        <?$this->load->view('admin/sites_side_box');?>
    <?}?>
</div>
<!-- Content -->

<?$this->load->view('admin/footer');?>